Overview
CDL provides a number of specific mechanisms for handling data in distributed parallel environments. Active objects (threads, call-backs, methods and circuits) can all own 'workspace' data objects which persist across multiple method iterations, and in many ways provide an equivalent of thread specific data.
Methods can also own 'state' objects, which are similar to workspace objects, but in the specific case of 'slave-able' methods, which can be scheduled to execute on any CPU, the state data object is automatically moved (and cached) to whichever machine executes the method instance.
How to Choose Whether to Use State or Workspace
Constants and tables that are calculated once and do not change (e.g. FFT twiddle coefficients) should always be stored in workspace (each slave will have a cached copy). Data that is potentially updated on each iteration must be stored in state to ensure that a method that moves its execution to another machine has a current copy of the data. State data needs to be moved each time the target processor changes and therefore it should only be used when necessary. For more detail see State and Workspace Objects.